package jmu.wj.service.impl;

import jmu.wj.mapper.EmpMapper;
import jmu.wj.pojo.Emp;
import jmu.wj.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author jxxyw
 */
@Service
@Transactional
public class EmpServiceImpl implements EmpService {
    @Autowired
    private EmpMapper empMapper;

    @Override
    @Transactional(propagation = Propagation.SUPPORTS)
    public List<Emp> finaAll() {
        return empMapper.finaAll();
    }

    @Override
    public void save(Emp emp) {
        empMapper.save(emp);
    }

    @Override
    public void delete(String id) {
        empMapper.delete(id);
    }

    @Override
    public Emp finaOne(String id) {
         return empMapper.findOne(id);
    }

    @Override
    public void update(Emp emp) {
        empMapper.update(emp);
    }
}
